

#ifndef __AC33Mx128_H__
#define __AC33Mx128_H__



// SCU
#define SCU_BASE_ADDRESS					(0x40000000)

// ADC
#define ADC0_BASE_ADDRESS					(0x4000B000)
#define ADC1_BASE_ADDRESS					(0x4000B100)
#define ADC2_BASE_ADDRESS					(0x4000B200)


// I2C
#define I2C0_BASE_ADDRESS					(0x4000A000)
#define I2C1_BASE_ADDRESS					(0x4000A100)


// MPWM
#define MPWM0_BASE_ADDRESS					(0x40004000)
#define MPWM1_BASE_ADDRESS					(0x40005000)



// UART
#define UART0_BASE_ADDRESS					(0x40008000)
#define UART1_BASE_ADDRESS					(0x40008100)
#define UART2_BASE_ADDRESS					(0x40008200)
#define UART3_BASE_ADDRESS					(0x40008300)



// DMAC
#define DMAC0_BASE_ADDRESS					(0x40000400)
#define DMAC1_BASE_ADDRESS					(0x40000410)
#define DMAC2_BASE_ADDRESS					(0x40000420)
#define DMAC3_BASE_ADDRESS					(0x40000430)
#define DMAC4_BASE_ADDRESS					(0x40000440)
#define DMAC5_BASE_ADDRESS					(0x40000450)
#define DMAC6_BASE_ADDRESS					(0x40000460)
#define DMAC7_BASE_ADDRESS					(0x40000470)
#define DMAC8_BASE_ADDRESS					(0x40000480)
#define DMAC9_BASE_ADDRESS					(0x40000490)
#define DMAC10_BASE_ADDRESS					(0x400004A0)
#define DMAC11_BASE_ADDRESS					(0x400004B0)
#define DMAC12_BASE_ADDRESS					(0x400004C0)
#define DMAC13_BASE_ADDRESS					(0x400004D0)
#define DMAC14_BASE_ADDRESS					(0x400004E0)


// FLASH
#define FLASH_BASE_ADDRESS					(0x40000100)




// WDT
#define WDT_BASE_ADDRESS					(0x40000200)



// AFE 
#define AFE_BASE_ADDRESS					(0x4000B300)



// GPIO
#define GPIO_A_BASE_ADDRESS					(0x40002000)
#define GPIO_B_BASE_ADDRESS					(0x40002100)
#define GPIO_C_BASE_ADDRESS					(0x40002200)
#define GPIO_D_BASE_ADDRESS					(0x40002300)


// PCU
#define PCU_A_BASE_ADDRESS					(0x40001000)
#define PCU_B_BASE_ADDRESS					(0x40001100)
#define PCU_C_BASE_ADDRESS					(0x40001200)
#define PCU_D_BASE_ADDRESS					(0x40001300)
#define PCU_PORTEN_ADDRESS					(0x40001FF0)



// 16-bit TIMER 
#define TIMER0_BASE_ADDRESS					(0x40003000)
#define TIMER1_BASE_ADDRESS					(0x40003020)
#define TIMER2_BASE_ADDRESS					(0x40003040)
#define TIMER3_BASE_ADDRESS					(0x40003060)
#define TIMER8_BASE_ADDRESS					(0x40003100)
#define TIMER9_BASE_ADDRESS					(0x40003120)


// SPI
#define SPI0_BASE_ADDRESS					(0x40009000)
#define SPI1_BASE_ADDRESS					(0x40009100)




//============================================================================	
// 
//		S R A M (4KB)
//
//============================================================================	
#define SRAM_BASE_ADDRESS					(0x20000000)




//============================================================================
// Entire NVIC Address 
//
//					SCS			= 0xE000_E000 ~ 0xE000_E00F
//					SYSTICK		= 0xE000_E010 ~ 0xE000_E01F
//					NVIC		= 0xE000_E100 ~ 0xE000_E4EF
//					SCB			= 0xE000_ED00 ~ 0xE000_EF03
//
//					TPIU			= 0xE004_0000 ~
//
//============================================================================					
#define SCS_BASE_ADDRESS					(0xE000E000UL)
#define SYSTICK_BASE_ADDRESS				(0xE000E010UL)
#define NVIC_BASE_ADDRESS					(0xE000E100UL)
#define SCB_BASE_ADDRESS					(0xE000ED00UL)

#define TPIU_BASE_ADDRESS					(0xE0040000UL)


#ifndef KEIL_MDK
#define	__enable_irq()		__asm ("CPSIE I")
#define	__disable_irq()		__asm ("CPSID I")
#define	__wfi()				__asm ("wfi")
#endif


#define WARNING_


#endif 

